<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/web-frame/element/js/vue.js"></script>
</head>
<body>
<div id="app">
    <span>{{ publishedBooksMessage }}</span>
</div>
<script>
        var Main = {
            data() {
                return {
                    author: {
                        name: 'John Doe',
                        books: [
                            'Vue 2 - Advanced Guide',
                            'Vue 3 - Basic Guide',
                            'Vue 4 - The Mystery'
                        ]
                    }
                }
            },
            created(){

            },
            methods: {

            },
            computed: {
                // 计算属性的 getter
                publishedBooksMessage() {
                    // `this` 指向 vm 实例
                    return this.author.books.length > 0 ? 'Yes' : 'No'
                }
            }
        }
        var Ctor = Vue.extend(Main)
        new Ctor().$mount('#app')
</script>
</body>
</html>